<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OrderDetail extends Model
{
    protected $fillable=[
        'order_num','goods_id','product_id','num','price'
    ];

//    订单详情和商品表的模型关联方法
    public function goods(){
        return $this->belongsTo(Goods::class);
    }
//    订单详情和货品表的模型关联方法
    public function product(){
        return $this->belongsTo(Product::class);
    }

}
